package com.apple.iphone.scheduling;

import com.apple.iphone.service.InventoryInquiryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @program: iphone
 * @ClassName TimedTask
 * @description:
 * @author: Liujg
 * @create: 2020-10-27 22:26
 * @Version 1.0
 **/
@Component
public class TimedTask {
    @Autowired
    private InventoryInquiryService inventoryInquiryService;

    /**
     * 表示每隔1秒 执行一次查询12Pro库存
     */
    @Scheduled(fixedRate = 1000)
    private void monitorInventory12Pro() {
        inventoryInquiryService.intervalQuery12Pro();
    }

    /**
     * 表示每隔10.5秒 执行一次12库存
     */
    @Scheduled(fixedRate = 10500)
    private void monitorInventory12() {
        inventoryInquiryService.intervalQuery12();
    }
}
